import { Injectable } from '@angular/core';
import { Router } from '@angular/router';
import { HttpRequest } from "../../../service/httpRequest";

@Injectable()
export class WeibaoService {

  weibaoId:string = '';
  username:string = '';
  constructor(
    private httpRequest:HttpRequest,
    private _router: Router){
    this.username = JSON.parse(localStorage.getItem('account'))['username'];
  }

  getData(){
    return this.httpRequest.sendGet('weibao/detail',{id:this.weibaoId});
  }


  save(params){
    return this.httpRequest.sendPost('weibao/queren',params);
  }

  getMans(){
    return this.httpRequest.sendGet('weibao/getqueren',{weibao_id:this.weibaoId});
  }

  getTime(){
    return this.httpRequest.gettoday();
  }

  cancel(){
    this._router.navigateByUrl('page/archives/weibao');
  }
}
